删除某字符

字符数组
#ifdef a
//删除某字符（字符数组）
#include<stdio.h>
#include<string.h>
void DelectSameChar(char input[], char delect_word) {
    int sz = 0;
    char tmp[100] = { 0 };
    strcpy(tmp, input);
    char* point = tmp;
    while (*point) {
        if (*point != delect_word) {
            input[sz++] = *point;
       }
        point++;
    }
    input[sz] = '\0';
}
int main() {
    char input[100] = { 0 };
    scanf("%s", input);
    char delect_word;
    getchar();//读取空格
    printf("输入要删除的字符>>");
    scanf("%c", &delect_word);
    DelectSameChar(input, delect_word);
    puts(input);
}
#endif
